package com.wootion.cims.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.wootion.cims.module.communitypersonal.model.Person;
import com.wootion.cims.module.communityresidence.household.excel.ExcelDto;
import com.wootion.cims.module.communityservice.dto.PersonDto;
import com.wootion.cims.module.communityservice.excel.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.wootion.cims.module.communityresidence.occupancy.excel.ExcelRules;

import java.util.Date;
import java.util.List;

/**
 * @Author: YaoYiChao
 */
@Mapper
public interface PersonDao extends BaseMapper<Person> {
    /**
     * 根据条件拆查询业主信息
     */
    PageDTO<PersonDto> findPage(@Param("page")PageDTO<PersonDto> page,@Param("condition")String condition);
    


    /**
     * 修改业主的居住性质
     * @param person
     * @return
     */
    int updateLivehold(Person person);
    /**
     * 入住人员excel导出
     * @return
     */
    List<ExcelRules> occFindByIdsExcel(ExcelRules excelRules);
    
    /**
     * 批量删除入组人员，软删除
     * @param ids
     * @return
     */
    int updateAbodeId(@Param("ids") List<String> ids);

    /**
     * 户籍成员列表导出
     * @param excelDto
     * @return
     */
    List<ExcelDto> houseFindByIdsExcel(ExcelDto excelDto);

    /**
     * 老年人列表查询
     * @param page
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param livingStatus
     * @param survivalSkills
     * @param highSubsidy
     * @return
     */
    PageDTO<PersonDto> oldPersonList(@Param("page") PageDTO<PersonDto> page,
                                     @Param("communityIds")List<String> communityIds,
                                     @Param("keyWord")String keyWord,
                                     @Param("residenceCategory")String residenceCategory,
                                     @Param("communityId")String communityId,
                                     @Param("plotId")String plotId,
                                     @Param("detailedAddress")String detailedAddress,
                                     @Param("houseNumber")String houseNumber,
                                     @Param("gender")String gender,
                                     @Param("nation")String nation,
                                     @Param("staterDate")Date staterDate,
                                     @Param("endDate")Date endDate,
                                     @Param("livingStatus")String livingStatus,
                                     @Param("survivalSkills")String survivalSkills,
                                     @Param("highSubsidy")Boolean highSubsidy
                                     );

    /**
     * 老年人信息列表导出
     * @param personIds
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param livingStatus
     * @param survivalSkills
     * @param highSubsidy
     * @return
     */
    List<OldPeopleExcel> oldPeopleExcel(@Param("personIds")List<String> personIds,
                                  @Param("communityIds")List<String> communityIds,
                                  @Param("keyWord")String keyWord,
                                  @Param("residenceCategory")String residenceCategory,
                                  @Param("communityId")String communityId,
                                  @Param("plotId")String plotId,
                                  @Param("detailedAddress")String detailedAddress,
                                  @Param("houseNumber")String houseNumber,
                                  @Param("gender")String gender,
                                  @Param("nation")String nation,
                                  @Param("staterDate")Date staterDate,
                                  @Param("endDate")Date endDate,
                                  @Param("livingStatus")String livingStatus,
                                  @Param("survivalSkills")String survivalSkills,
                                  @Param("highSubsidy")Boolean highSubsidy);

    /**
     * 残疾人列表查询
     * @param page
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param disabilityNo
     * @param disabilityType
     * @param disabilityLevel
     * @param isLife
     * @param isCare
     * @return
     */
    PageDTO<PersonDto> disabilityPersonList(@Param("page") PageDTO<PersonDto> page,
                                     @Param("communityIds")List<String> communityIds,
                                     @Param("keyWord")String keyWord,
                                     @Param("residenceCategory")String residenceCategory,
                                     @Param("communityId")String communityId,
                                     @Param("plotId")String plotId,
                                     @Param("detailedAddress")String detailedAddress,
                                     @Param("houseNumber")String houseNumber,
                                     @Param("gender")String gender,
                                     @Param("nation")String nation,
                                     @Param("staterDate")Date staterDate,
                                     @Param("endDate")Date endDate,
                                     @Param("disabilityNo")String disabilityNo,
                                     @Param("disabilityType")String disabilityType,
                                     @Param("disabilityLevel")String disabilityLevel,
                                     @Param("isLife")Boolean isLife,
                                     @Param("isCare")Boolean isCare
    );

    /**
     * 残疾人信息列表导出
     * @param personIds
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param disabilityNo
     * @param disabilityType
     * @param disabilityLevel
     * @param isLife
     * @param isCare
     * @return
     */
    List<DisabilityExcel> disabilityExcel(@Param("personIds")List<String> personIds,
                                          @Param("communityIds")List<String> communityIds,
                                          @Param("keyWord")String keyWord,
                                          @Param("residenceCategory")String residenceCategory,
                                          @Param("communityId")String communityId,
                                          @Param("plotId")String plotId,
                                          @Param("detailedAddress")String detailedAddress,
                                          @Param("houseNumber")String houseNumber,
                                          @Param("gender")String gender,
                                          @Param("nation")String nation,
                                          @Param("staterDate")Date staterDate,
                                          @Param("endDate")Date endDate,
                                          @Param("disabilityNo")String disabilityNo,
                                          @Param("disabilityType")String disabilityType,
                                          @Param("disabilityLevel")String disabilityLevel,
                                          @Param("isLife")Boolean isLife,
                                          @Param("isCare")Boolean isCare);

    /**
     * 低保户信息列表查询
     * @param page
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param certificateNo
     * @param amount
     * @param type
     * @return
     */
    PageDTO<PersonDto> subsistencePersonList(@Param("page") PageDTO<PersonDto> page,
                                             @Param("communityIds")List<String> communityIds,
                                             @Param("keyWord")String keyWord,
                                             @Param("residenceCategory")String residenceCategory,
                                             @Param("communityId")String communityId,
                                             @Param("plotId")String plotId,
                                             @Param("detailedAddress")String detailedAddress,
                                             @Param("houseNumber")String houseNumber,
                                             @Param("gender")String gender,
                                             @Param("nation")String nation,
                                             @Param("staterDate")Date staterDate,
                                             @Param("endDate")Date endDate,
                                             @Param("certificateNo")String certificateNo,
                                             @Param("amount")String amount,
                                             @Param("type")String type);

    /**
     * 低保户信息ecel导出
     * @param personIds
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param certificateNo
     * @param amount
     * @param type
     * @return
     */
    List<SubsistenceExcel> subsistenceExcel(@Param("personIds")List<String> personIds,
                                            @Param("communityIds")List<String> communityIds,
                                            @Param("keyWord")String keyWord,
                                            @Param("residenceCategory")String residenceCategory,
                                            @Param("communityId")String communityId,
                                            @Param("plotId")String plotId,
                                            @Param("detailedAddress")String detailedAddress,
                                            @Param("houseNumber")String houseNumber,
                                            @Param("gender")String gender,
                                            @Param("nation")String nation,
                                            @Param("staterDate")Date staterDate,
                                            @Param("endDate")Date endDate,
                                            @Param("certificateNo")String certificateNo,
                                            @Param("amount")String amount,
                                            @Param("type")String type);

    /**
     * 党员信息列表查询
     * @param page
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param joinPartyTime
     * @param shiftToTime
     * @return
     */
    PageDTO<PersonDto> memberList(@Param("page") PageDTO<PersonDto> page,
                                  @Param("communityIds")List<String> communityIds,
                                  @Param("keyWord")String keyWord,
                                  @Param("residenceCategory")String residenceCategory,
                                  @Param("communityId")String communityId,
                                  @Param("plotId")String plotId,
                                  @Param("detailedAddress")String detailedAddress,
                                  @Param("houseNumber")String houseNumber,
                                  @Param("gender")String gender,
                                  @Param("nation")String nation,
                                  @Param("staterDate")Date staterDate,
                                  @Param("endDate")Date endDate,
                                  @Param("joinPartyTime")Long joinPartyTime,
                                  @Param("shiftToTime")Long shiftToTime);

    /**
     * 党员信息excel导出
     * @param personIds
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param joinPartyTime
     * @param shiftToTime
     * @return
     */
    List<MemberExcel> memberExcel(@Param("personIds") List<String> personIds,
                                  @Param("communityIds")List<String> communityIds,
                                  @Param("keyWord")String keyWord,
                                  @Param("residenceCategory")String residenceCategory,
                                  @Param("communityId")String communityId,
                                  @Param("plotId")String plotId,
                                  @Param("detailedAddress")String detailedAddress,
                                  @Param("houseNumber")String houseNumber,
                                  @Param("gender")String gender,
                                  @Param("nation")String nation,
                                  @Param("staterDate")Date staterDate,
                                  @Param("endDate")Date endDate,
                                  @Param("joinPartyTime")Long joinPartyTime,
                                  @Param("shiftToTime")Long shiftToTime);

    /**
     * 优抚信息列表查询
     * @param page
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param enlistmentTime
     * @param demobilizationTime
     * @param category
     * @param entitledGroups
     * @return
     */
    PageDTO<PersonDto> specialList(@Param("page") PageDTO<PersonDto> page,
                                   @Param("communityIds")List<String> communityIds,
                                   @Param("keyWord")String keyWord,
                                   @Param("residenceCategory")String residenceCategory,
                                   @Param("communityId")String communityId,
                                   @Param("plotId")String plotId,
                                   @Param("detailedAddress")String detailedAddress,
                                   @Param("houseNumber")String houseNumber,
                                   @Param("gender")String gender,
                                   @Param("nation")String nation,
                                   @Param("staterDate")Date staterDate,
                                   @Param("endDate")Date endDate,
                                   @Param("enlistmentTime")Long enlistmentTime,
                                   @Param("demobilizationTime")Long demobilizationTime,
                                   @Param("category")String category,
                                   @Param("entitledGroups")String entitledGroups);

    /**
     * 优抚信息excfel导出
     * @param personIds
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param enlistmentTime
     * @param demobilizationTime
     * @param category
     * @param entitledGroups
     * @return
     */
    List<SpecialExcel> specialExcel(@Param("personIds") List<String> personIds,
                                    @Param("communityIds")List<String> communityIds,
                                    @Param("keyWord")String keyWord,
                                    @Param("residenceCategory")String residenceCategory,
                                    @Param("communityId")String communityId,
                                    @Param("plotId")String plotId,
                                    @Param("detailedAddress")String detailedAddress,
                                    @Param("houseNumber")String houseNumber,
                                    @Param("gender")String gender,
                                    @Param("nation")String nation,
                                    @Param("staterDate")Date staterDate,
                                    @Param("endDate")Date endDate,
                                    @Param("enlistmentTime")Long enlistmentTime,
                                    @Param("demobilizationTime")Long demobilizationTime,
                                    @Param("category")String category,
                                    @Param("entitledGroups")String entitledGroups);
    List<String> queryNameTel(@Param("name")String name,@Param("tel")String tel);
    /**
     * 租户信息列表查询
     * @param page
     * @param communityIds
     * @param resids
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param residencePermit
     * @return
     */
    PageDTO<PersonDto> tenantList(@Param("page") PageDTO<PersonDto> page,
                               @Param("communityIds")List<String> communityIds,
                               @Param("resids")List<String> resids,
                               @Param("keyWord")String keyWord,
                               @Param("residenceCategory")String residenceCategory,
                               @Param("communityId")String communityId,
                               @Param("plotId")String plotId,
                               @Param("detailedAddress")String detailedAddress,
                               @Param("houseNumber")String houseNumber,
                               @Param("gender")String gender,
                               @Param("nation")String nation,
                               @Param("staterDate")Date staterDate,
                               @Param("endDate")Date endDate,
                               @Param("residencePermit")String residencePermit);

    /**
     * 租户信息excel导出
     * @param personIds
     * @param resids
     * @param communityIds
     * @param keyWord
     * @param residenceCategory
     * @param communityId
     * @param plotId
     * @param detailedAddress
     * @param houseNumber
     * @param gender
     * @param nation
     * @param staterDate
     * @param endDate
     * @param residencePermit
     * @return
     */
    List<TenantExcel> tenantExcel(@Param("personIds") List<String> personIds,
                                  @Param("resids")List<String> resids,
                                  @Param("communityIds")List<String> communityIds,
                                  @Param("keyWord")String keyWord,
                                  @Param("residenceCategory")String residenceCategory,
                                  @Param("communityId")String communityId,
                                  @Param("plotId")String plotId,
                                  @Param("detailedAddress")String detailedAddress,
                                  @Param("houseNumber")String houseNumber,
                                  @Param("gender")String gender,
                                  @Param("nation")String nation,
                                  @Param("staterDate")Date staterDate,
                                  @Param("endDate")Date endDate,
                                  @Param("residencePermit")String residencePermit);

}
